package view
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	import flash.ui.Mouse;
	
	public class BottomSprite extends Sprite
	{
		[Embed(source='assets/components/bottom.png')]
		private var bottom:Class;
		
		[Embed(source='assets/components/bottomBtn.png')]
		private var bottomBtn:Class;
		
		public function BottomSprite()
		{
			init();
		}
		private function init():void{
			var bottomBitmap:Bitmap = new bottom();
			this.addChild(bottomBitmap);
			
			var bottomBtnBitmap:Bitmap = new bottomBtn();
			this.addChild(bottomBtnBitmap);
			bottomBtnBitmap.x = 30;
			bottomBtnBitmap.y = 10;
			
			var txt:TextField = new TextField;
			txt.width = bottomBtnBitmap.width;
			txt.height = 30;
			txt.selectable = false;
			txt.htmlText = "<a href='event:myevent'><font color='#FF6600' size='25' face='黑体' >下单</font></a>";
			this.addChild(txt);
			txt.x = 60;
			txt.y = 18;
			txt.addEventListener(MouseEvent.CLICK,onclick);
		}
		private function onclick(event:MouseEvent):void{
			this.dispatchEvent(new Event(Event.SELECT));
		}
	}
}